#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>


char* interpret(char* command) {
    int n = strlen(command);
    char ans[7];
    memset(ans, 0, sizeof(char) * n);
    int j = 0;
    int i = 0;
    while (i < n)
    {
        if (command[i] == 'G')
        {
            ans[j++] = 'G';
            i++;
        }
        else if (command[i] == '(' && i + 1 < n && command[i + 1] == ')')
        {
            ans[j++] = 'o';
            i += 2;
        }
        else if (command[i] == '(' && i + 1 < n && command[i + 1] == 'a')
        {
            ans[j++] = 'a';
            ans[j++] = 'l';
            i += 4;
        }
        else
            i++;
    }
    strncpy(command, ans, j);
    command[j] = '\0';
    return command;
}

int main()
{
    char commned[] = { "G()(al)" };
    char* ret = interpret(commned);
    printf("%s\n", ret);
    return 0;
}